package com.fujica.invoicing.controller;

import com.fujica.invoicing.request.sell.SellReq;
import com.fujica.invoicing.service.ISellService;
import com.fujica.invoicing.utils.Result;
import com.fujica.invoicing.utils.ResultBody;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName SellController
 * @Description TODO  售货
 * @Author admin
 * @Date 2020/8/14 11:06
 * @Version 1.0
 **/

@RestController
@RequestMapping("invoicing/sell")
@Api(tags = "售货")
public class SellController {

    @Autowired
    private ISellService iSellService;


    @PostMapping
    public Result sell(@RequestBody SellReq req) {

        if (req.getStoreId() > 0) {
            return iSellService.sell(req);
        }

        return ResultBody.badReq("传输参数有误");
    }
}
